file_name=open('text.txt','w')
a=['1','2','3','4','5']
for i in a:
    file_name.write(str(i*20))
file_name.close()
file_name1=open('text.txt','r')
g1=file_name1.read(10)
g2=file_name1.read(40)
sum=0
for i in g2:
    j=int(i)
    sum+=j
print(sum)

##################################
# f=open('text.txt','a')
# a=['1','2','3','4','5']
# s=f.writelines(a*20)
# f.close()
# f=open('text.txt','r')
# f.seek(10,0)
# a=f.read()
# add=0
# for i in a:
#     add+=int(a)
# print(i)